/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package newkfp;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author $alama
 */
@Stateless
public class ExporterFactoryFacade extends AbstractFacade<ExporterFactory> {
    @PersistenceContext(unitName = "KFPNEWPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public ExporterFactoryFacade() {
        super(ExporterFactory.class);
    }

    public List<ExporterFactory> getFactoriesByExporterId(Integer idExporter) {
          Query query = getEntityManager().createNamedQuery("ExporterFactory.factoriesByExporterId");
       Exporter ex=new Exporter(idExporter);
        query.setParameter("idexporter", ex);
        List list = query.getResultList();
        return list;
        
    }
    
}
